home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 April / CHIP 1996 aprilis (CD06).zip / CHIP_CD06.ISO / sac / pack / thd_12_1.exe / rar / THDEXARC.RAR / THDEXARC.TXT < prev   
Text File  |  1995-12-25  |  24KB  |  490 lines

  1.  
  2. ******************************* EDITORIAL NOTE *******************************
  3. **                                                                          **
  4. **    It should be noted that use of this utility is recommended against.   **
  5. ** It removes the "control" factor from THDPRO.EXE on which the entire      **
  6. ** security concept is based. With proper use, this utility can be a gift.  **
  7. ** However in the hands of people not "FULLY" aware of the power of the     **
  8. ** various utilities (and all of their quirks) this utility could allow you **
  9. ** to do uncontrollable damage to your system.                              **
  10. **    Unless you are absolutely certain that you need to use this and know  **
  11. ** absolutely everything about the archiver/scanner you intend to invoke    **
  12. ** using this utility, be aware that the results may not always be as       **
  13. ** "controllable" as you may anticipate.                                    **
  14. **                                                                          **
  15. ******************************************************************************
  16. **                                                                          **
  17. **      Although I will support this utility, I cannot promise to know      **
  18. **  anything about the various products you may configure for use with it.  **
  19. **                                                                          **
  20. ******************************************************************************
  21.  
  22.     THDEXARC.EXE is THD ProScan's External Archive Editor. It's purpose is to 
  23. allow the user to add external archive and virus scanner support to THD 
  24. ProScan Version 12.0 and later, by creating a data file with necessary 
  25. information for THDPRO.EXE to use these external archives and/or virus 
  26. scanners in it's normal running.
  27.  
  28.     Definitions found in THDEXARC.DAT (created by this utility) will only be 
  29. used IF THDEXARC.DAT exists in the same directory as THDPRO.EXE and IF the 
  30. archive type is not supported internally to THDPRO.EXE. An archive type 
  31. "normally" supported by THDPRO.EXE which is not defined in THDINSTL will be 
  32. considered unsupported for this definition and will be checked against the 
  33. types supported in THDEXARC.DAT. If however they are configured in THDINSTL, 
  34. the internal routines will be used.
  35.  
  36.     Conversion "to" external archive types is not supported by THDPRO.EXE, 
  37. however conversion "from" these types using the normal convert indicators is 
  38. supported.
  39.  
  40.     In the case of virus scanners, no comparison to internally configured 
  41. scanners is made, so you can opt to run the internally supported scanners via 
  42. this option with different parameters than set internally without a conflict 
  43. arising with those internal to THDPRO.EXE.
  44.  
  45.  
  46. KEYWORDS (replaceable strings if you prefer) are as simple as the following...
  47.  
  48. ~~A - use "A"rchiver instead of unarchiver
  49. ~~U - use "U"narchiver instead of archiver
  50. ~~F - "F"ilename for the current process
  51. ~~I - "I"nclude filenames or other relevant information.
  52. ~~D - "D"irectory
  53. ~~L - "L"og file (for scanners only)
  54.  
  55. If any of the above is entered in lower case they will be translated to upper 
  56. case prior to saving the record.
  57.  
  58.     The ~~A and ~~U are special keywords in that they are not actually 
  59. "replaced" on the command line. Instead they are simply stripped from the 
  60. command line and the archiver (~~A) or unarchiver (~~U) is used  instead of 
  61. the default. In order to understand this, you must realize that each of the 
  62. archive processes has a default executable.
  63.     In the case of the "test archive" command for instance, THDPRO.EXE will 
  64. use the "path to unarchiver" by default. If for some reason THDPRO.EXE should 
  65. be required to use the archiver (instead of the unarchiver) you could put ~~A 
  66. on the parameter line to tell THDPRO.EXE to use the "path to archiver" instead 
  67. of the "path to unarchiver". Putting ~~A in a parameter which normally uses 
  68. the Archiver will have no adverse effects (except to take up a few spaces in 
  69. your configurable space)
  70.  
  71.  
  72.     The other codes are replaced at run-time by THDPRO.EXE based on the 
  73. following. Codes not explained in any given entry are not supported for that 
  74. entry and have no translation value.
  75.  
  76.  
  77. IN THE SCANNER CONFIGURATION
  78. ----------------------------
  79.    Path to Scanner - None
  80.   Scan a directory - ~~D=name of the Directory to scan (no ending "\")
  81.                      ~~L=full path and filename of "heurist.Log"
  82.                          (or more accurately the temporary heuristic Log)
  83.        Scan a file - ~~F=full path and filename of the File to be
  84.                          scanned.
  85.                      ~~L=full path and filename of "heurist.Log"
  86.                          (or more accurately the temporary heuristic Log)
  87.  
  88. Success Errorlevel - None
  89.  
  90.  
  91. IN THE ARCHIVE CONFIGURATION
  92. ----------------------------
  93.  
  94.       Archive Type - None
  95.  Archive extension - None
  96.  Internal/External - None
  97.   Archive ID (hex) - None
  98.   Archive ID (chr) - None
  99.  Archive ID Offset - None
  100.   Path to Archiver - None
  101. Path to Unarchiver - None
  102.          Expansion - ~~F=full path and filename of the archive to be expanded
  103.                      ~~D=Current temporary directory used by THDPRO.EXE
  104.                      ~~A=Path to Archiver (use only if you wish the
  105.                          archiver to be used for this process instead of
  106.                          the unarchiver. If absent the unarchiver is used).
  107.        Compression - ~~F=full path and filename of the archive to be created
  108.                      ~~D=Current temporary directory used by THDPRO.EXE
  109.                      ~~U=Path to Unarchiver (use only if you wish the
  110.                          Unarchiver to be used for this process instead of
  111.                          the archiver. If absent the archiver is used).
  112.         Add a file - ~~F=full path and filename of the archive being tested
  113.                      ~~I=full path and filename of the file(s) to be added
  114.                      ~~U=Path to Unarchiver (use only if you wish the
  115.                          Unarchiver to be used for this process instead of
  116.                          the archiver. If absent the archiver is used).
  117.      Add a comment - ~~F=full path and filename of the archive being tested
  118.                      ~~I=full path and filename of the comment to be added
  119.                      ~~U=Path to Unarchiver (use only if you wish the
  120.                          Unarchiver to be used for this process instead of
  121.                          the archiver. If absent the archiver is used).
  122.       Test archive - ~~F=full path and filename of the archive being tested
  123.                      ~~I=No replacement values (will be left untouched)
  124.                      ~~A=Path to Archiver (use only if you wish the
  125.                          archiver to be used for this process instead of
  126.                          the unarchiver. If absent the unarchiver is used).
  127.     Delete by list - ~~F=full path and filename of the archive being tested
  128.                      ~~I=full path and filename of the list to be removed
  129.                      ~~U=Path to Unarchiver (use only if you wish the
  130.                          Unarchiver to be used for this process instead of
  131.                          the archiver. If absent the archiver is used).
  132. Delete by filename - ~~F=full path and filename of the archive being tested
  133.                      ~~I=full path and filename of the file(s) to be removed
  134.                      ~~U=Path to Unarchiver (use only if you wish the
  135.                          Unarchiver to be used for this process instead of
  136.                          the archiver. If absent the archiver is used).
  137. Success Errorlevel - none
  138.  
  139.  
  140. The Menu Interface
  141. ------------------
  142.  
  143.     The menu interface is "basic" meaning that it supports the up/down arrow 
  144. keys as well as the use of the highlighted "Hot Keys". <enter> selects the 
  145. highlighted option. <esc> is equivalent to the "Quit" option on each menu.
  146.     To select an option move the highlight by pressing the up and down arrow 
  147. keys and press the <enter> key when the correct option is highlighted. Or 
  148. press the highlighted letter of your selection.
  149.     Except as noted below the home key will move the highlight to the first 
  150. selection on the menu and the end key will move the highlight to the last 
  151. selection.
  152.  
  153.     In the view/edit/add modes the following keys serve a special purpose.
  154. Right = "N"ext
  155. Left  = "P"revious
  156. Home  = "F"irst
  157. End   = "L"ast
  158.  
  159.  
  160.     The menu commands will not be broken down in this text. Anyone incapable 
  161. of understanding the meanings of the various menu options should seriously 
  162. reconsider before trying to add or manipulate external archives or scanners.
  163.  
  164. IMPORT - EXPORT
  165. ---------------
  166.  
  167.     The "Import" option available from the Main Menu allows the user to 
  168. "import" definitions from a text file. This text file must contain a 
  169. definition in the precise format created by the "export" function (discussed 
  170. in the next paragraph) except that it will ignore any leading and/or trailing 
  171. spaces. This will allow easy importation of other's settings. The text 
  172. imported "from" can contain as many definitions as you like and may also 
  173. contain information other than the definitions (THDEXARC will search for the 
  174. definition portions and offer you the option to import each definition as it 
  175. is found).
  176.  
  177.     The "Export" option is available from the "View" menu. If you select the 
  178. "export" option you will be prompted if you wish to export the currently 
  179. displayed archiver or scanner or to export "all" records. If you select the 
  180. "all" option then all scanner AND archive definitions will be exported 
  181. regardless of which you are viewing. The export file is a simple text file and 
  182. can be edited without destroying the effectiveness as long as no lines which 
  183. are "used" are removed completely.
  184.  
  185.     Both of these options will prompt you to enter a filename with the 
  186. "default" being THDEXARC.EXP. You may supply another filename and/or a full 
  187. path and filename at your option. If the file exists on an export attempt you 
  188. will be asked if you wish to "overwrite" (replace the existing file), "append" 
  189. (add the new info to the end of the existing file) or "abort" (stop 
  190. exportation).
  191.  
  192. THDEXARC.EXP
  193. ------------
  194.     Included in the distribution archive is THDEXARC.EXP. This is a text file 
  195. which contains the "Export" of some archivers and scanners (most of which are 
  196. already supported internally). You can Import the various definitions via the 
  197. Import function from the main menu. It is distributed in this format to avoid 
  198. having THDPRO.EXE use THDEXARC.DAT unless it has been specifically configured.
  199. Note that the various Paths supplied in this file are not likely to exist on 
  200. your system and will almost certainly need to be corrected. This can be done 
  201. with a text editor or inside THDEXARC.EXE at the time of importation. Import 
  202. only those definitions that you wish to use and/or add your own. However 
  203. please take great care when using this utility. I cannot stress how little 
  204. control you may have if you're not fully aware of the capabilities of the 
  205. archivers or scanners that can be configured through it's use.
  206.  
  207. Configuration Breakdown
  208. -----------------------
  209.  
  210.     The breakdown of the configuration section goes like this.
  211.  
  212.     On first run (or any run where a THDEXARC.DAT does not exist in the 
  213. current directory), the "first" menu will only show 4 options. They are...
  214.  
  215. 1 Add an Archiver
  216. 2 Add a Virus Scanner
  217. 3 Import
  218. Q Quit
  219.  
  220.     After at least a single record exists you will be given the following
  221. options...
  222.  
  223. 1 View Current Archivers
  224. 2 View Current Scanners
  225. 3 Modify an Archiver
  226. 4 Modify a Virus Scanner
  227. 5 Add an Archiver
  228. 6 Add a Virus Scanner
  229. 7 Remove an Archiver
  230. 8 Remove a Virus Scanner
  231. 9 Import
  232. Q Quit
  233.  
  234.     The two "Remove" options when used result in "complete" removal of any
  235. records chosen to be removed. Records "Removed" cannot be recovered. However,
  236. all deletion is confirmed prior to any actual action.
  237.  
  238.                       *********************************
  239.                       * UNDER "ARCHIVE" CONFIGURATION *
  240.                       *********************************
  241.  
  242. These definitions are effective under all "archive" options except the
  243. "remove" and "quit" selections.
  244.  
  245. --------------
  246. Archive Type -
  247. --------------
  248.    The Name and version of the Archiver/Unarchiver who's action this entry is
  249. designed to account for (ie. PKZIP/PKUNZIP version 2.04g).
  250.  
  251. --------------------
  252. Archive extension  -
  253. --------------------
  254.    The "normal" extension of the archive type (ZIP for Zip, LZH for Lha etc)
  255. [ capital letters are forced ]
  256.  
  257. -------------------
  258. Internal/External -
  259. -------------------
  260.    This entry is a toggle. Selecting it toggles support from External (use the 
  261. info in the THDEXARC file) to Internal (use THDPRO.EXE's internal 
  262. identification and handling routines).
  263.  
  264.     IN ALMOST ALL CASES THIS SHOULD BE SET TO EXTERNAL!!!
  265.  
  266. This will signify that you are defining an archive type not supported by 
  267. THDPRO.EXE.
  268.     The setting of INTERNAL is a special case which tells THDPRO.EXE, that the 
  269. archive type is already support internally but the search for the 
  270. Identification needs to be adjusted by the number in ID_OFFSET in order for 
  271. THDPRO.EXE to properly identify the archive type.
  272.     In order to understand how this might be used, see the "Internal Support" 
  273. notes at the end of this document.
  274.  
  275. ------------------
  276. Archive ID (hex) -
  277. Archive ID (chr) -
  278. ------------------
  279.    Either of these will allow you to "input" archive identification characters
  280. in HEXADECIMAL format (00-FF). These can usually be seen in a hex editor or
  281. other hexadecimal viewer. The "?" is a reserved character and may NOT be used
  282. in the archive id (hex 3F). The ? is used to indicate that a character in
  283. "this" position may be any character. PKZIP for instance might be entered as
  284. 50,4B,03,04,??,??,??,??,??,??,??,??,??,??,??. Which is translated into.. Only
  285. the first four characters are significant and they must be 50,4B,03,04 IN THAT
  286. ORDER. The "hex" entry is where input is made, the "chr" entry is for display
  287. purposes only and will show the actual character represented by the hex code
  288. entered.
  289.     LHA archives could be identified here as...
  290. 2D,6C,68,??,2D,??,??,??,??,??,??,??,??,??,??
  291. which would require a match for the first three and fifth character while
  292. allowing the fourth character to be anything. (The Id offset for this pattern
  293. in LHA archives is at position "2")
  294.     In cases where it would be easier to enter the actual character than it's
  295. "hex" equivalent, you may do this by entering it with a preceding "=". So for
  296. PKZIP for instance one could alternately enter it as...
  297. =P,=K,03,04,??,??,??,??,??,??,??,??,??,??,??.
  298.     The "=" tells the interpreter that the second character is the actual
  299. character to be entered and it in turn "translates" that character into it's
  300. appropriate hex code. So entering "=P" would result in "50" showing in the
  301. space where that was entered (as "50" is the hex equivalent of a capital "P").
  302. The "P" itself would be displayed on the (chr) line below. This works for all
  303. "typable" characters.
  304.  
  305. -------------------
  306. Archive ID Offset -
  307. -------------------
  308.     Number of bytes from the beginning of the archive at which the Archive ID
  309. is located. The "first" byte of the archive is "0" (not 1). Thus "ZIP"
  310. archives with the above signature would have an offset of "0".
  311.  
  312. ------------------
  313. Path to Archiver -
  314. ------------------
  315.    The full path and filename of the archiver (ie C:\TOOLS\PKZIP.EXE). This
  316. entry MUST represent a full path and filename (drive preferred but not
  317. required) [ capital letters are forced ]
  318.  
  319. --------------------
  320. Path to Unarchiver -
  321. --------------------
  322.    The full path and filename of the UNarchiver (ie C:\TOOLS\PKUNZIP.EXE). 
  323. This entry MUST represent a full path and filename (drive preferred but not 
  324. required). An entry of "=" will cause it to match the "Path to Archiver" entry 
  325. above. [ capital letters are forced ]
  326.  
  327. -----------
  328. Expansion -
  329. -----------
  330.     The parameters required by the UNARCHIVER to expand an archive of this 
  331. type for PKZIP for instance, one might enter "-d -o- ~~F" (meaning to recreate 
  332. directories and never overwrite existing files)
  333.  
  334. -------------
  335. Compression -
  336. -------------
  337.     Although not "currently" supported by THDPRO.EXE, this field should be 
  338. defined as the parameters necessary for the ARCHIVER to create an archive 
  339. including all subdirectories which may be under it. . For PKZIP, one might use 
  340. "-arp ~~F"
  341.  
  342. ------------
  343. Add a file -
  344. ------------
  345.     Parameters used to "add a file" to this particular archive. The "archiver"
  346. is normally used for this purpose. For PKZIP you might use "-a ~~F ~~I".
  347.  
  348. ---------------
  349. Add a comment -
  350. ---------------
  351.     The parameters required by the Archiver to add an archive comment. For
  352. PKZIP one might use "-a ~~F -z > ~~I"
  353.  
  354. --------------
  355. Test archive -
  356. --------------
  357.     The parameters used by the Unarchiver to "test" the CRC of an archive. For
  358. PKZIP "-t ~~F".
  359.  
  360. ----------------
  361. Delete by list -
  362. ----------------
  363.     The parameters required by the Archiver to delete files via a list where
  364. ~~F will be replaced by the full path and name of the archive and ~~I will be
  365. replaced by the full path and filename of the "list". For PKZIP "-d ~~F @~~I"
  366.  
  367. --------------------
  368. Delete by filename -
  369. --------------------
  370.     The parameters required by the Archiver to delete files BY NAME where ~~F
  371. will be replaced by the full path and name of the archive and ~~I will be
  372. replaced by the filename(s) of the file(s) to be removed.
  373. For PKZIP "-d ~~F ~~I"
  374.  
  375. --------------------
  376. Success Errorlevel -
  377. --------------------
  378.     The errorlevel returned when the various command lines have encountered
  379. no errors in their execution (usually "0"). Note that THDPRO.EXE evaluates
  380. this errorlevel in the same way as "DOS". An errorlevel less than or equal
  381. to the value entered here is considered a "pass".
  382.  
  383.  
  384.                     *********************************
  385.                     * UNDER "SCANNER" CONFIGURATION *
  386.                     *********************************
  387.  
  388. These definitions are effective under all "scanner" options except the
  389. "remove" and "quit" selections.
  390.  
  391. ---------
  392. Scanner -
  393. ---------
  394.     The Name and Version of the scanner represented by this entry. For example
  395. "McAfee's VirusScan Version 2.2.5."
  396.  
  397. -----------------
  398. Path to Scanner -
  399. -----------------
  400.    The full path and filename of the Virus Scanner (ie C:\SCAN\SCAN.EXE). This
  401. entry MUST represent a full path and filename (drive preferred but not
  402. required) [ capital letters are forced ]
  403.  
  404. ------------------
  405. Scan a directory -
  406. ------------------
  407.     The parameters required to scan all files in a directory and all of it's
  408. subdirectories. for Mcafee's SCAN you might use "/all /sub /nomem ~~D\*.*".
  409.  
  410. -------------
  411. Scan a file -
  412. -------------
  413.     The parameters required to scan a single file. for Mcafee's SCAN you might
  414. use "/all /nomem ~~F".
  415.  
  416. --------------------
  417. Success Errorlevel -
  418. --------------------
  419.     The errorlevel returned when no viruses are found. (usually "0") Note that
  420. THDPRO.EXE evaluates this errorlevel in the same way as "DOS". An errorlevel
  421. less than or equal to the value entered here is considered a "pass".
  422.  
  423. Notes -
  424.  
  425.     Prior to saving any records, This program records the CRC of the
  426. executable file(s) of the record for use by the SECURE mode of THDPRO.EXE. The
  427. time required to do this will vary depending on the size of the executables.
  428.  
  429.     If running THDPRO.EXE in secure mode, the CRC's above can be "corrected"
  430. by "edit"ing the path to any one of the executable files of the record in
  431. question. This will cause the CRC's to be recalculated for the executables
  432. in that record. Running THDPRO.EXE /SEC has no effect on the THDEXARC CRC
  433. records and will not correct the CRC's stored therein. Note however that none
  434. of these CRC's should change unless you have changed the file that they point
  435. to. You should be EXTREMELY suspicious if you find yourself needing to
  436. correct a CRC contained in the THDEXARC.DAT file if you have not changed
  437. the file(s) affected.
  438.  
  439.     All archive records are sorted upon exit from the program in reverse order
  440. based on the archive identification strings. The sorting is required to ensure
  441. that THDPRO.EXE attempts archive identification in the correct order. No
  442. "sorting" of scanner entries is necessary.
  443.  
  444. ------------------
  445. Internal Support -
  446. ------------------
  447.    In order to understand when one might set the Internal/External toggle on 
  448. an archive type to "INTERNAL" one needs to understand how THD looks for it's 
  449. archive identification internally as well as what THD looks for. Under all 
  450. "normal" circumstances, THD looks for the archive identification at offset "0" 
  451. in any given archive type ("2" for LHA).
  452.    When looking at SFX files THD reads the executable header for the "size" of 
  453. the executable header and changes its starting point by that amount. This 
  454. works fine for DOS SFX files since the actual archive is simply appended to an 
  455. executable file. However OS/2 and Windows have a different executable 
  456. structure and the "size" THD finds can simply be the size the the "dos stub". 
  457. This stub is then followed by a portion of code specific to OS/2 or Windows. 
  458. (Some OS/2 SFX types do return the proper size and do not need to be accounted 
  459. for by this method.)
  460.    THDPRO.EXE would thus not be able to identify that file as an archive as it 
  461. would be searching for the ID in the OS/2 or Win executable portion instead of 
  462. the archive. What is needed is a way to tell THDPRO.EXE to "skip" a specific 
  463. number of bytes to locate the id header.
  464.     When setting an archive type to INTERNAL, most fields are ignored. The 
  465. only "significant" field in the record is the ID_OFFSET. THD will (if it fails 
  466. to recognize the archive internally) check again beginning with the id_offset 
  467. as specified in any internal THDEXARC entries. It will restart a new internal 
  468. search using the offset provided by THDEXARC and defining the archive as 
  469. whichever internal identification it matches. If it matches none of the 
  470. internal archive types, it is defined as an unrecognized type.
  471.    A sample of this type of use is included in THDEXARC.EXP, and I may be 
  472. happy to help those who may need it for other purposes (although I may require 
  473. you to send me the archiver or possibly a few sample archives of the type 
  474. which needs to be defined). I have accounted for the RAR occurrences of this 
  475. type. The [OS/2] LH and ZIP SFX formats I tested do not need to be accounted 
  476. for as they both returned the correct size and are recognized by THDPRO.EXE 
  477. without this consideration.
  478.     It is important to remember that "internal" means internal to THDPRO.EXE. 
  479. Those types defined as "internal" will NOT be compared to any other records 
  480. stored in the THDEXARC.DAT file and therefore will ONLY work if THDINSTL.EXE 
  481. has been configured to use the particular archiver you intend to support using 
  482. this method. If the archiver is NOT configured internally, then make the 
  483. definition an external one and fill in all necessary fields.
  484.  
  485.     If in doubt, ask. This option (and indeed, this tool) is not for the 
  486. average user.
  487.  
  488.     THAT'S ALL FOLKS!!
  489. Good luck.
  490.